home *** CD-ROM | disk | FTP | other *** search
- ü
- Database Tutorial - Second Part
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- û
- Hello and welcome to the second part of my Database tutorial. In
- the last doc, we looked at a simple phonebook as an example. Again, I
- shall be using a phonebook method, but will be implementing newer
- options into the program, so that you can learn how to adapt them into
- your own programs.
-
- ÷
- The main option we will be looking at this time, is multi-field
- file searching. This is an essential in most cases, as you would often
- know the phone number of someone, but don't know who it belongs to. A
- search option could be used to look for the number. Other good field
- searches are towns, and e-mail numbers.
-
- ù
- Because I am going to change the layout of the program a little, I
- will have to change the structure of which it saves and reads files. I
- have around 60 entries on my data disk using the old program, and
- because I am a nice guy, I have also written a converter, which just
- so happens to change your old files, into compatability with the new
- system. See the section labelled PROGRAM CHANGES for more information
- ÿ
- ù
- on why.
-
- I am also introducing a system of PowerPacking files down a little
- bit, to save space on the data disk. In order for this to work, you
- must have the Compiler.Lib extension in AMOSPro, and
- POWERPACKER.LIBRARY in your LIBS: drawer. If you do not have the
- extension, then changes in the program will be added at the bottom.
-
- ý
- Program Changes
- ~~~~~~~~~~~~~~~
- þ
- Several changes have been made to the mainframe workings of the
- program. The most important being, that the system no longer uses
- multi-file access. All possible records are stored in one big file,
- which is kept in the memory. This means that when a search is called,
- the command HUNT can be used, which is the fastest way of finding
- strings in the AMOS memory.
-
- As I mentioned before, I have implemented Powerpacker, a file
- cruncher which reduces the size of the file saved to the disk, yet is
- unpacked to the correct size when loaded back into memory. This only
- ÿ
- þ
- kicks in when the file to be saved is over 50K, which is around 10-12
- records minimum. PowerPacker has a crunch rate of around 45% on
- average. In order for PP to work, you will need the Compiler.Lib of
- the AMOSPro Compiler extension, and the POWERPACKER.LIBRARY in the
- LIBS: drawer of your bootdisk. If you don't have the facilities for
- the powerpacker commands, then I will also document on how to use
- standard AMOS commands. If you have Classic AMOS, then it is possible
- for you to use the EASYLIFE extension, providing you have it, which
- saves pure powerpacker files, where as the AMOSPro files are saved
- with a special AMOS header, so that they can be recognized when they
- are loaded back in. Easylife files can be crunched and de-crunched
- with a standard powerpacker program.
-
- ú
- The program will now open a small prefs file, which controls some
- extremely simple options, mainly being the way that the data is saved.
- You can change the size of the executable before it is powerpacked, as
- well as if it is to be crunched at all, and if the main data file is
- to be saved after every new entry. This is a lot faster on a HD
- machine, and is only reccomended that a HD version has this option
- turned on, unless the floppy version is a very small file.
- ÿ
- ø
-
- Apart from the above, only minor changes have been made to the
- system. Everything has been iggledy-piggledy'd around, but still runs
- exactly the same, with no further new additions.
-
- ü
- Getting Started
- ~~~~~~~~~~~~~~~
- ù
- In case you didn't follow the last tutorial, all features in their
- new form will be documented in full, as I will need to inform you of
- any changes that I have made. All programs (as usual) will be included
- on the SOURCE drawer, on disk 2 of this issue. If not, then you can
- get in touch with me at the address at the end of this file, where I
- will be happy to sort you out with the appropriate programs.
-
- ý
- Important Note
- ~~~~~~~~~~~~~~
- ú
- Because of the nasty bugs that are in AMOSPro, the program may
- sometimes crash when the PPSave command is used. I also will be using
- an EXECALL function (alters the system) to help speed things up when
- the disk drives and keyboard are not in use (mainly when searching),
- ÿ
- ú
- and if the program is brought into editor mode whilst the call is
- active, then it will definately crash if the menu is called up. What I
- am trying to say is SAVE YER SODDIN' WORK FIRST !!
-
- û
- OK, the rest of the tutorial is about explaining the program
- itself, and so the best way to do that I feel, is to actually place
- all of the comments in the actual program listing !! See ya over
- there, dudes !!
-
- ý
- Remember, the address to write to me with any kind of problems, or
- if you have any programs or tips, or just want to chat, then write to :
-
- û
- Andrew "Mushroom" Kellett
- Mushroom PD
- 32 Castleton Crescent
- Gamesley
- Glossop
- Derbyshire
- SK13 9TH
- ÷
- EOF
-
-